import request from "@/utils/request";

/**
 * 角色列表
 * @returns {Promise<any>}
 */
export async function getRole() {
  return request('/admin/role')
}

/**
 * 添加角色
 * @returns {Promise<any>}
 */
export async function addRole(data) {
  return request.post('/admin/role',{data})
}

/**
 * 角色详情
 * @returns {Promise<any>}
 */
export async function showRole(params) {
  return request(`/admin/role/${params}?include=permissions`)
}

/**
 * 角色更新
 * @returns {Promise<any>}
 */
export async function updateRole(params,data) {
  return request.put(`/admin/role/${params}`,{data})
}


/**
 * 角色删除
 * @returns {Promise<any>}
 */
export async function delRoleServe(params) {
  return request.delete(`/admin/role/${params}`)
}
